<template>
	<view>
		<view class="cu-timeline">
			<view class="cu-time">记录</view>
			<view class="cu-item cur cuIcon-noticefill">
				<view v-for="(item,index) in signRecords" :key="index" class="content bg-green shadow-blur">
					<view>
						<text style="font-size: 22px;">【主题】</text>
						<text style="font-size: 18px;"><text>"</text>{{item.theme}}<text>"</text></text>
					</view>
					<view>
						<text style="font-size: 14px ; margin-left: 110px; margin-top: 20px;">——{{item.beginTime}}</text>
					</view>
				</view>
			</view>
		</view>
		<view v-if="flag" style="height: 145px;">
			<view style="margin-top: 40px;margin-bottom: 10px;margin-left: 140px">
				<image style="width: 110px; height: 110px;" src="@/static/icons/nodata.png"></image>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {ref} from 'vue';
	import {getSignRecords} from '@/api/sign.js';
	import {onLoad} from '@dcloudio/uni-app';
	import {share} from '@/utils/share.js';
	
	const signRecords = ref([]);
	const flag = ref(false);
	onLoad(async() => {
		share();
		const userInfo = uni.getStorageSync('user');
		await getSignRecords(userInfo.phone).then(res => {
			if(res.code === 200){
				signRecords.value = res.data;
				if(res.data === null){
					flag.value = true;
				}
			}
		});
	});
</script>

<style scoped lang="scss">

</style>